package ejd.security.sinoe;

import java.io.IOException;

import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;

import org.apache.ws.security.WSPasswordCallback;

public class PasswordCallback implements CallbackHandler {

	@Override
	public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
	    WSPasswordCallback callback = (WSPasswordCallback) callbacks[0];
	    System.out.println(" callback sinoe = " + callback.getIdentifier());
	    if("USRSNOCMA".equals(callback.getIdentifier())){
	        callback.setPassword("29a23795746f4acbcf5eab478854a4232c54be96c547999ce6367073bd3e6494e70411d41c46a58e6ad059650c4e425c6202187d0e23746f919b0d5b793f6e8b");
	    }
	}

}
